package com.yonyou.pmclouds.project.rmiitf;

import com.yonyou.pmclouds.basecom.entity.PageObject;
import com.yonyou.pmclouds.basecom.exception.BusinessException;
import com.yonyou.pmclouds.project.entity.ProjectBillStatisticsVO;
import com.yonyou.pmclouds.project.entity.ProjectRefVO;
import com.yonyou.pmclouds.project.entity.ProjectVO;
import com.yonyou.pmclouds.project.entity.ProjectViewVO;

import java.util.List;
import java.util.Map;

/**
 * 项目相关、耗时较短的查询
 */
public interface ProjectSimpleQuery {
    /**
     * 查询项目经理是指定用户的项目
     * <br>
     * 该接口强制限制查询数量，以期避免一些错误
     *
     * @see com.yonyou.pmclouds.basecom.util.CommonProgramConsts#DEFAULT_MAX_QUERY_SIZE
     */
    PageObject<ProjectVO> queryByManagerOrCreator(String user, String keyword, Byte state, int start, int offset) throws BusinessException;

    ProjectVO queryProject(String id) throws BusinessException;

    ProjectViewVO queryProjectViewVO(String id) throws BusinessException;

    ProjectViewVO queryProjectViewVOByPkSrc(String pkTenant, String pkSrc) throws BusinessException;

    ProjectVO queryByPkSrc(String pkTenant, String pkSrc) throws BusinessException;

    /**
     * 为项目的参照性质的批量查询、提供的接口
     * <br>
     * 该接口强制限制查询数量，以期避免一些错误
     *
     * @see com.yonyou.pmclouds.basecom.util.CommonProgramConsts#DEFAULT_MAX_QUERY_SIZE
     */
    Map<String, ProjectRefVO> queryRefs(String[] ids) throws BusinessException;

    Map<String, ProjectVO> queryProjects(String[] ids) throws BusinessException;

    ProjectVO[] queryProjectByTenant(String tenantid, Byte state) throws BusinessException;

    ProjectBillStatisticsVO[] queryStatistics(String projectId) throws BusinessException;

    // 根据项目ids查找到项目类型map
    Map<String, String> queryProjectTypesByProjects(String[] pkProjects) throws BusinessException;

    // 根据项目ids查找到项目状态map
    Map<String, String> queryProjectStatusByProjects(String[] pkProjects) throws BusinessException;

    String queryProjectStatusByProject(String pkProject) throws BusinessException;

    String queryProjectTypeByProject(String pkProject) throws BusinessException;

    Map<String, String> queryProjectNameByIds(String[] ids) throws BusinessException;

    /**
     * 通过模糊匹配项目名查询项目
     *
     * @param fuzzyName 模糊名
     * @return
     * @throws BusinessException
     */
    List<ProjectVO> queryProjectsByFuzzyName(String fuzzyName, String pkTenant) throws BusinessException;

    /**
     * 根据组织查询项目档案
     * @param pkOrgs
     * @return
     */
    Map<String,List<ProjectVO>> queryProjectsByOrgs(String pkTenant, String[] pkOrgs);

    String[] queryProjectIdByTenantOrg(String keyword, String tenant, String org);

    ProjectVO[] queryProjectIdByTenantOrgExt(String tenant, String org);

    /**
     * 查询PMC自制档案
     *
     * @param pkTenant
     * @return
     * @throws BusinessException
     */
    ProjectVO[] queryPMCProjects(String pkTenant);

    ProjectVO[] queryVOByIds(String[] ids) throws BusinessException;

    String[] queryProjectIdsByOrgs(String pkTenant, String[] orgIds) throws BusinessException;


    /**
     * 检验项目档案类型是否被引用
     */
    Boolean quote(String pkTenant,String code,String[] ids);//


    /**
     *  返回项目看板数据
     */
    Map<String,Object> queryProjectBoardById(String projectId,String pkPlan) throws BusinessException;




    /**
     *  返回项目看板数据
     */
    Map<String,Object> queryPlanBoardByProSrcId(String pkProSrc) throws BusinessException;


    /**
     * 指标报表项目筛选数据
     */
    List<ProjectVO> queryProjectsByTypeAndOrgs(String pkTenant, String pkOrgs,String[] projectTypes,String[] projectIds);
}
